<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>

<link href='https://fonts.loli.net/css?family=Merriweather:900,900italic,300,300italic&subset=latin-ext' rel='stylesheet' type='text/css' /><link href='https://fonts.loli.net/css?family=Lato:900,300&subset=latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; --title-bar-height:20px; }
.mac-os-11 { --title-bar-height:28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { white-space: pre-wrap; }
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px; }
thead, tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
svg { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
  #write { margin-top: 0px; border-color: transparent !important; padding-top: 0px !important; padding-bottom: 0px !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  .typora-export #write { break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  .is-mac table { break-inside: avoid; }
  #write > p:nth-child(1) { margin-top: 0px; }
  .typora-export-show-outline .typora-export-sidebar { display: none; }
  figure { overflow-x: visible; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.reversefootnote { font-family: ui-monospace, sans-serif; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.6; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
  .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex:2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
  .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
  .typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; overflow-wrap: anywhere; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: ""; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: ""; }
.outline-h1 > .outline-item { padding-left: 0px; }
.outline-h2 > .outline-item { padding-left: 1em; }
.outline-h3 > .outline-item { padding-left: 2em; }
.outline-h4 > .outline-item { padding-left: 3em; }
.outline-h5 > .outline-item { padding-left: 4em; }
.outline-h6 > .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open > .outline-item > .outline-expander::before { content: ""; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open > .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: "−"; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }
.md-inline-math-container mjx-container { zoom: 0.95; }
mjx-container { break-inside: avoid; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; outline: 0px; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: auto hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 10px; z-index: 3; overflow-y: hidden; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; inset: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
span.cm-underlined { text-decoration: underline; }
span.cm-strikethrough { text-decoration: line-through; }
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
.cm-tw-deleted { text-decoration: line-through; }
.cm-tw-header5 { font-weight: 700; }
.cm-tw-listitem:first-child { padding-left: 10px; }
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
.cm-tw-underline { text-decoration: underline; }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}


@include-when-export url(https://fonts.loli.net/css?family=Merriweather:900,900italic,300,300italic&subset=latin-ext);
@include-when-export url(https://fonts.loli.net/css?family=Lato:900,300&subset=latin-ext);

:root {
	--control-text-color: #777;
}

/**
 * forked from pixyll.com
 * MIT license
 */

h1,
.h1,
.f1 {
	font-size: 2rem;
	line-height: 2.5rem;
}
h2,
.h2,
.f2 {
	font-size: 1.5rem;
	line-height: 2rem;
}
h3,
.h3,
.f3 {
	font-size: 1.25rem;
	line-height: 1.5rem;
}
p,
.p,
.f4,
h4,
h5,
h6,
dl,
ol,
ul,
pre[cid],
div[cid],
#typora-source {
	font-size: 1.125rem;
	line-height: 1.5rem;
}

h4 {
	font-size: 1.13rem;
}
/*
 Pixyll
 A simple, beautiful theme for Jekyll that emphasizes content rather than aesthetic fluff.
 Best served with BASSCSS (http://jxnblk.github.io/basscss)
 Crafted with <3 by John Otander (@4lpine) - ©2015 John Otander MIT License http://opensource.org/licenses/MIT

*/

body {
	font-family: "Merriweather", "PT Serif", Georgia, "Times New Roman", "STSong", 'Segoe UI Emoji', Serif;
	line-height: 1.5rem;
	font-weight: 400;
}

#write {
	max-width: 914px;
	color: #333;
}

@media only screen and (min-width: 1400px) {
	#write {
		max-width: 1100px;
	}
}

@media only screen and (min-width: 1700px) {
	#write {
		max-width: 1200px;
	}
}

img {
	width: auto;
	max-width: 100%;
}
body {
	font-size: 1.5rem;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
}

.ty-table-edit {
	background: #ededed;
}

table {
	width: 100%;
	font-size: 1.125rem;
}
table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td,
table > tfoot > tr > th,
table > tfoot > tr > td {
	padding: 12px;
	line-height: 1.2;
	vertical-align: top;
	border-top: 1px solid #333;
}
table > thead > tr > th {
	vertical-align: bottom;
	border-bottom: 2px solid #333;
}
table > caption + thead > tr:first-child > th,
table > caption + thead > tr:first-child > td,
table > colgroup + thead > tr:first-child > th,
table > colgroup + thead > tr:first-child > td,
table > thead:first-child > tr:first-child > th,
table > thead:first-child > tr:first-child > td {
	border-top: 0;
}
table > tbody + tbody {
	border-top: 2px solid #333;
}
p {
	font-weight: 300;
	line-height: 1.5;
}
abbr {
	border-bottom: 1px black dotted;
	cursor: help;
}
pre,
code {
	font-family: Menlo, Monaco, "Courier New", monospace;
}

code,
.md-fences  {
	color: #7a7a7a;
}

.md-fences {
	padding: 1.125em;
	margin-bottom: 0.88em;
	font-size: 1rem;
	border: 1px solid #7a7a7a;
	padding-bottom: 0.5rem;
	padding-top: 0.5rem;
}

blockquote {
	padding: 1.33em;
	font-style: italic;
	border-left: 5px solid #7a7a7a;
	color: #555;
}
blockquote em {
	color: #000;
}
blockquote footer {
	font-size: .85rem;
	font-style: normal;
	background-color: #fff;
	color: #7a7a7a;
	border-color: transparent;
}
h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
	font-family: "Lato", 'Helvetica Neue', Helvetica, sans-serif;
	font-weight: bold;
	line-height: 1.2;
	margin: 1em 0 0.5em;
}
@media screen and (min-width: 48em) {
	.h1,
	h1 {
		font-size: 3.250rem;
	}
	.h2,
	h2 {
		font-size: 2.298rem;
	}
	.h3,
	h3 {
		font-size: 1.625rem;
	}
	.h4,
	h4 {
		font-size: 1.3rem;
	}
	#write>h4.md-focus:before,
	#write>h5.md-focus:before,
	#write>h6.md-focus:before{
		top: 1px;
	}
	.p,
	p,
	li {
		font-size: 1.25rem;
		line-height: 1.8;
	}
	table {
		font-size: 1.25rem;
	}
}
@media (max-width: 48em) {
	blockquote {
		margin-left: 1rem;
		margin-right: 0;
		padding: 0.5em;
	}
	.h1,
	h1 {
		font-size: 2.827rem;
	}
	.h2,
	h2 {
		font-size: 1.999rem;
	}
	.h3,
	h3 {
		font-size: 1.413rem;
	}
	.h4,
	h4 {
		font-size: 1.3rem;
	}
}
@media screen and (min-width: 64em) {
	.h1,
	h1 {
		font-size: 4.498rem;
	}
	.h2,
	h2 {
		font-size: 2.29rem;
	}
	.h3,
	h3 {
		font-size: 1.9rem;
	}
	.h4,
	h4 {
		font-size: 1.591rem;
	}
	#write>h4.md-focus:before{
		top:4px;
	}
}
a {
	color: #463F5C;
	text-decoration: underline;
}

#write {
	padding-top: 2rem;
}

#write pre.md-meta-block {
	min-height: 35px;
	padding: 0.5em 1em;
	white-space: pre;
	border: 0px;

	border-left: 30px #f8f8f8 solid;
	border-right: 30px #f8f8f8 solid;
	width: 100vw;
	max-width: calc(100% + 60px);

	margin-left: -30px;
	margin-bottom: 2em;
	margin-top: -2010px;
	padding-top: 2000px;
	padding-bottom: 10px;
	line-height: 1.5em;
	color: #7a7a7a;
	background-color: #fafafa;
	font-family: 'Lato', 'Helvetica Neue', Helvetica, sans-serif;
	font-weight: 300;
	clear: both;
	padding-left: 0;
	font-size:1.125rem;
}
.md-image>.md-meta {
	color: #463F5C
}
.footnotes {
	font-size:1.1rem;
}
.md-tag {
	font-family: 'Lato', 'Helvetica Neue', Helvetica, sans-serif;
}
.code-tooltip {
	background: white;
}
.code-tooltip-content {
	font-size: 1.1rem;
}

.task-list{
	padding-left: 0;
}

.md-task-list-item {
	padding-left:34px;
}

.md-task-list-item > input{
	width: 1.25rem;
	height: 1.25rem;
	display: block;
	-webkit-appearance: initial;
	top: -0.2rem;
	margin-left: -1.6em;
	margin-top: calc(1rem - 7px);
	border: none;
}

.md-task-list-item > input:focus{
	outline: none;
	box-shadow: none;
}

.md-task-list-item > input:before{
	border: 1px solid #555;
	border-radius: 1.5rem;
	width: 1.5rem;
	height: 1.5rem;
	background: #fff;
	content: ' ';
	transition: background-color 200ms ease-in-out;
	display: block;
}

.md-task-list-item > input:checked:before,
.md-task-list-item > input[checked]:before{
	background: #333;
	border-width: 2px;
	display:inline-block;
	transition: background-color 200ms ease-in-out;
}

.md-task-list-item > input:checked:after,
.md-task-list-item > input[checked]:after {
	opacity: 1;
}

.md-task-list-item > input:after {
	opacity: 1;
	-webkit-transition: opacity 0.05s ease-in-out;
	-moz-transition: opacity 0.05s ease-in-out;
	transition: opacity 0.05s ease-in-out;
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	transform: rotate(-45deg);
	position: absolute;
	top: 0.4375rem;
	left: 0.28125rem;
	width: 0.9375rem;
	height: 0.5rem;
	border: 3px solid #fff;
	border-top: 0;
	border-right: 0;
	content: ' ';
	opacity: 0;
}

.md-tag {
	color:inherit;
}

.md-toc:focus .md-toc-content{
	margin-top: 19px;
}

#typora-sidebar {
	font-size:1rem !important;
}

.html-for-mac #typora-sidebar {
	background-color:white;
}

.outline-content li, .outline-content ul {
	font-size:1rem !important;
}

.outline-title {
	line-height: inherit;
	margin-top: 10px;
}

.outline-expander {
	width: 18px;
}

.outline-expander:before {
 	content: "+";
	font-family: inherit;
	color: rgb(108, 108, 108); 
  font-size: 1.5rem;
 	top: -0.1rem;
}

.outline-expander:hover:before {
	content: "+";
}

.outline-item-open>.outline-item>.outline-expander:before{
	content: "-";
}

/** source code mode */
#typora-source {
	font-family: Courier, monospace;
    color: #6A6A6A;
}

.os-windows #typora-source {
	font-family: inherit;
}

.cm-s-typora-default .cm-header, 
.cm-s-typora-default .cm-property,
.CodeMirror.cm-s-typora-default div.CodeMirror-cursor {
	color: #428bca;
}

.cm-s-typora-default .cm-atom, .cm-s-typora-default .cm-number {
	color: #777777;
}

.md-diagram-panel {
	margin-top: 24px;
	margin-left: -1.2em;
}

.md-mathjax-midline {
	background: #fafafa;
}

.enable-diagrams pre.md-fences[lang="sequence"] .code-tooltip,
.enable-diagrams pre.md-fences[lang="flow"] .code-tooltip,
.enable-diagrams pre.md-fences[lang="mermaid"] .code-tooltip {
    bottom: -3.4em;
}

.dropdown-menu .divider {
	border-color: #e5e5e5;
}

li {
	margin: 0.5rem 0;
}

li > *:last-child {
	margin-bottom: 0;
}


</style><title>GESP一级直通车</title>
</head>
<body class='typora-export os-windows typora-export-show-outline typora-export-no-collapse-outline'><div class='typora-export-content'>
<div class="typora-export-sidebar"><div class="outline-content"><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#gesp一级直通车">GESP一级直通车</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#gesp一级考什么">GESP一级考什么？</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#gesp一级题型有哪些">GESP一级题型有哪些？</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#考场小贴士-1">考场小贴士</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#一计算机基础与编程">一、计算机基础与编程</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#11-计算机的分类">1.1 计算机的分类 </a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#12-重要计算机科学家">1.2 重要计算机科学家</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#13-计算机的构成">1.3 计算机的构成 </a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#14-计算机语言常识">1.4 计算机语言常识 </a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#15-真题解析">1.5 真题解析</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#二变量定义与输入输出语句">二、变量定义与输入输出语句</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#21-变量名命名规则">2.1 变量名命名规则</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#22-输入输出语句">2.2 输入输出语句</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#23-真题解析">2.3 真题解析</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#三基本数据类型整型浮点型字符型布尔型）">三、基本数据类型（整型、浮点型、字符型、布尔型）</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#真题解析">真题解析</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#四控制语句顺序选择循环）">四、控制语句（顺序、选择、循环）</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#41-顺序结构">4.1 顺序结构</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#42-选择结构">4.2 选择结构</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#43-循环结构">4.3 循环结构</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#44-真题解析">4.4 真题解析</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#五基本运算算数运算关系运算逻辑运算）">五、基本运算（算数运算、关系运算、逻辑运算）</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#51-算术运算">5.1 算术运算</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#52-关系运算">5.2 关系运算</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#53-逻辑运算符">5.3 逻辑运算符</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3 outline-item-open"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#54-真题解析">5.4 真题解析</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#考场小贴士-2">考场小贴士：</a></div><ul class="outline-children"></ul></li></ul></li></div></div><div id='write'  class=''><h1 id='gesp一级直通车'><span>GESP一级直通车</span></h1><blockquote><p><span>一篇梳理GESP编程能力等级考试一级C++语言全部知识架构，掌握重点，吃透难点，摆平易错点。</span></p></blockquote><p><span>你需要预先知道的：</span></p><h2 id='gesp一级考什么'><span>GESP一级考什么？</span></h2><ol start='' ><li><p><a href='#一计算机基础与编程'><span>计算机基础与计算机历史</span></a></p></li><li><p><a href='#二变量定义与输入输出语句'><span>变量的定义与输入，输出语句</span></a></p></li><li><p><a href='#三基本数据类型整型浮点型字符型布尔型）'><span>基本数据类型（整型、浮点型、字符型、布尔型）</span></a></p></li><li><p><a href='#四、控制语句结构（顺序、循环、选择）'><span>控制语句结构（顺序、循环、选择）</span></a></p></li><li><p><a href='#五基本运算算数运算关系运算逻辑运算）'><span>基本运算（算数运算、关系运算、逻辑运算）</span></a></p></li></ol><h2 id='gesp一级题型有哪些'><span>GESP一级题型有哪些？</span></h2><p><span>15个单选题，10个判断题，每题2分，共50分。</span></p><p><span>2个编程题，每题25分，共50分。</span></p><h2 id='考场小贴士-1'><a href='#考场小贴士考场小贴士'><span>考场小贴士</span></a></h2><h2 id='一计算机基础与编程'><span>一、计算机基础与编程</span></h2><blockquote><p><span>复习目标：这部分内容考察的范围广应用浅，属于了解知道即可。</span></p><p><span>小技巧：时不必死记硬背，多读几遍就行。</span></p></blockquote><p><img src="一级_计算机基础与历史.png" referrerpolicy="no-referrer"></p><h3 id='11-计算机的分类'><span>1.1 计算机的分类 </span></h3><ul><li><p><span>按年代分类</span></p><p><img src="计算机发展过程.png" referrerpolicy="no-referrer"></p></li><li><p><span>按性能分类</span></p><p><span>巨型机&gt;大/中型机&gt;小型机&gt;微型机=工作站。</span></p><p><span>一般按照规模大小、性能、能耗等分类。</span></p><ul><li><p><span>巨型机（超级计算机，简称「超算」）：</span><strong><span>速度极快，容量极高，体积极大</span></strong><span>。高速度，大容量，因而能够承担重大的科学研究，用于</span><strong><span>计算地震/太空/天气预报</span></strong><span>等复杂用途，</span><strong><span>我国的有：银河/天河</span></strong><span>等。</span></p><p><span>巨型机运算速度平均每秒千万次以上，存储容量千万位以上。</span></p></li></ul><p><img src="银河和天河.png" referrerpolicy="no-referrer"></p><p>&nbsp;</p><ul><li><p><span>大/中型机：</span><strong><span>速度快，容量极高，体积大</span></strong><span>。高可靠性，可用性，服务型，主要用于</span><strong><span>顶尖科研领域</span></strong><span>。</span></p></li><li><p><span>小型机：</span><strong><span>速度快，容量高，体积中</span></strong><span>。主要用于</span><strong><span>单位服务器/其他领域</span></strong><span>。</span></p></li></ul><p><span>小型机采用精简指令集处理器，性能和价格介于PC服务器和大型主机之间的一种高性能 64 位计算机。</span></p><p><span>小型机主要用于金融证券和交通等对业务的单点运行具有高可靠性的行业应用。</span></p><ul><li><p><span>微型机：</span><strong><span>速度快，容量中，体积小</span></strong><span>。主要用于</span><strong><span>个人工作/处理数据，20 世纪 70 年代后非常普及（电脑大部分都是微型机）</span></strong><span>。各位同学面前的电脑、笔记本、手机等等基本上都是微型机。</span></p></li></ul></li><li><p><span>工作站：</span><strong><span>速度快，容量中，体积小</span></strong><span>。用于</span><strong><span>辅助微型机工作</span></strong><span>。</span></p></li></ul><h3 id='12-重要计算机科学家'><span>1.2 重要计算机科学家</span></h3><p><img src="cn-turing-jumbo.jpg" style="zoom:25%;" /></p><ul><li><p><span>阿兰·艾伦·图灵（英）：数学家，逻辑学家，计算机科学/人工智能之父，</span><strong><span>首次提出了计算机科学理论</span></strong><span>。计算机界的最高奖项“图灵奖”以他命名，被称为“计算机界的诺贝尔奖”。</span></p></li></ul><p><img src="冯诺依曼.jpeg" style="zoom:20%;" /></p><ul><li><p><span>冯·诺依曼（美）：科学家，现代计算机之父，</span><strong><span>首次提出了存储程序控制原理</span></strong><span>，称为“冯·诺依曼结构”。</span></p><p>&nbsp;</p><p><img src="克劳德香农.jpeg" style="zoom:50%;" /></p></li><li><p><span>克劳德·香农（美）：科学家，创造了信息论，</span><strong><span>提出了某种信息从一处传送到另一处所需的全部设备所构成的系统</span></strong><span>。</span></p><p>&nbsp;</p></li></ul><h3 id='13-计算机的构成'><span>1.3 计算机的构成 </span></h3><p><span>要想实现计算机的基础功能，计算机必须由</span><strong><span>运算器、存储器、控制器、输入设备、输出设备</span></strong><span>构成，缺少前两者就无法正常启动计算机，即为“冯·诺依曼结构”。</span></p><ul><li><p><span>CPU（Central Processing Unit）：中央处理器，由</span><strong><span>运算器（计算）+控制器（指挥）+寄存器</span></strong><span>组成。</span></p></li></ul><p><strong><span>计算机的核心部件</span></strong><span>，被称为计算机的“大脑”，又称“微处理器”。</span></p><ul><li><p><span>内存储器：简称“内存”，用于</span><strong><span>电脑内部</span></strong><span>的存储。相对外存而言，</span><strong><span>读写速度快，但是存储空间小</span></strong><span>，并且存储在 RAM 里的数据</span><strong><span>断电后会丢失</span></strong><span>。注意与“外存（硬盘等）”区分开。</span></p></li><li><p><span>RAM（Random Access Memory）：随机存取存储器，与CPU直接交互数据，可随时读写，</span><strong><span>断电数据全部丢失</span></strong><span>。</span></p></li><li><p><span>ROM（Read-Only Memory）：只读存储器，只能读出无法写入信息。信息一旦写入后就固定下来，</span><strong><span>断电数据不会丢失</span></strong><span>，故又称为固定存储器。</span></p></li><li><p><span>外存储器：简称“外存”，用于处置长期保存的数据，一般</span><strong><span>处于电脑外部</span></strong><span>，</span><strong><span>断电后数据不会丢失</span></strong><span>。相对内存而言，外存</span><strong><span>读写速度慢，但存储容量大</span></strong><span>。主要包括硬盘、光盘、U 盘（USB闪存盘）等类型。</span></p></li><li><p><span>输入设备：在计算机与人交互时，</span><strong><span>接受外部命令或者需要加工的数据</span></strong><span>。常用的输入数据包括键盘、鼠标、麦克风、摄像头等。</span></p></li><li><p><span>输出设备：在计算机与人交互时，</span><strong><span>将处理结果以人类能够识别/感受的方式呈现出来</span></strong><span>的设备。常有的输出设备包括显示器、音响、打印机等。</span></p></li><li><p><span>访问速度：寄存器&gt;高速缓存&gt;内存&gt;外存。</span></p></li><li><p><span>断电后数据保留于 ROM 和外存。</span></p></li></ul><p>&nbsp;</p><h3 id='14-计算机语言常识'><span>1.4 计算机语言常识 </span></h3><ul><li><p><span>机器语言/机器码：最早的语言，</span><strong><span>计算机能识别的语言</span></strong><span>，</span><strong><span>由二进制数字 0/10/1 组成</span></strong><span>，速度快，人类编码难度高，一般由计算机自动转换。</span></p></li><li><p><span>汇编语言：用符号代替二进制数，</span><strong><span>计算机不能直接识别</span></strong><span>，需要用编译器进行编译，难度依然很大，目前除了对性能要求极高的需求以外不被使用。</span></p></li><li><p><span>高级语言：如今的编程语言（C++，JAVA 等），需要用编译器，难度小，分为编译方式和解释方式两种编译方式。</span></p><ul><li><p><span>编译方式（C++）：先对整个程序进行编译（会进行多次分析），再执行程序。速度快（进行多次编译对程序进行优化）。</span></p></li><li><p><span>解释方式（Python/PHP）：扫描一行解释一行，速度慢（无法进行优化）。</span></p></li></ul><p>&nbsp;</p></li></ul><h3 id='15-真题解析'><span>1.5 真题解析</span></h3><p><span>单选题：</span></p><p><span>1.以下奖项与计算机领域最相关的是（）。</span></p><p><span> A. 奥斯卡奖  </span></p><p><span>B. 图灵奖  </span></p><p><span>C. 诺贝尔奖  </span></p><p><span>D. 普利策奖</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>图灵奖（Turing Award），是由美国计算机协会（ACM）于1966年设立的计算机奖项，名称取自阿兰·图灵（Alan M. Turing），旨在奖励对计算机事业作出重要贡献的个人。图灵奖一般每年仅授予一名计算机科学家。图灵奖是计算机领域的国际最高奖项，被誉为“计算机界的诺贝尔奖”。</span></p><p><span>从1966年至2021年，图灵奖共授予75名获奖者，以美国、欧洲科学家为主。2000年，华人科学家姚期智获图灵奖，是华人第一次也是唯一一次获得图灵奖。</span></p><p><span>正确选项B。</span></p><p>&nbsp;</p><p><span>2.提出“存储程序”的计算机工作原理的是（）。 </span></p><p><span>A. 冯·诺依曼  </span></p><p><span>B. 克劳德·香农  </span></p><p><span>C. 戈登·摩尔  </span></p><p><span>D. 查尔斯·巴比奇</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><ul><li><p><span>冯·诺依曼</span></p></li></ul><p><span>美籍匈牙利数学家：冯.诺依曼提出了计算机“存储程序”的计算机设计理念，即将计算机指令进行编码后存储在计算机的存储器中，需要的时候可以顺序地执行程序代码，从而控制计算机运行。</span></p><p><span>早期的计算机设计中，程序和数据是俩个截然不同的概念，数据放在存储器中，而程序作为控制器的一部分，这样的计算机计算效率低，灵活性较差。冯.诺依曼结构中，将程序和数据一样看待，将程序编码为数据，然后与数据一同存放在存储器中，这样计算机就可以调用存储器中的程序来处理数据了。意味着，无论什么程序，最终都是会转换为数据的形式存储在存储器中，要执行相应的程序只需要从存储器中依次取出指令、执行。这种设计思想导致了硬件和软件的分离，即硬件设计和程序设计可以分开执行。</span></p><ul><li><p><span>克劳德·香农</span></p></li></ul><p><span>克劳德·香农是美国数学家，密码学家。1948年，他发表了划时代的论文——《通讯的数学理论》，奠定了现代信息论的基础。 还被认为是数字计算机理论和数字电路设计理论的创始人。</span></p><ul><li><p><span>戈登·摩尔</span></p></li></ul><p><span>戈登·摩尔是英特尔的创始人之一，他将自己的经验总结为“摩尔定律”，其核心内容为：集成电路上可以容纳的晶体管数目在大约每经过18个月到24个月便会增加一倍。换言之，处理器的性能大约每两年翻一倍，同时价格下降为之前的一半。</span></p><ul><li><p><span>查尔斯·巴比奇</span></p></li></ul><p><span>查尔斯·巴贝奇，19世纪英国数学家、发明家兼机械工程师。由于提出了差分机与分析机的设计概念（并有部份实做机器），被视为计算机先驱。</span></p><p><span>正确选项A。</span></p><p>&nbsp;</p><p><span>3.以下不是存储设备的是（）。</span></p><p><span> A. 光盘 </span></p><p><span>B. 磁盘 </span></p><p><span>C. 固态硬盘 </span></p><p><span>D. 鼠标</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>存储设备是用于储存信息的设备或装置。通常是将信息数字化后再以利用电、磁或光学等方式的媒体加以储存。</span></p><p><span>常见的储存设备有：</span></p><p><span>利用电能方式储存信息的装置如：各式随机存取存储器（RAM）、只读存储器（ROM）、固态硬盘（SSD）等</span>
<span>利用光学方式储存信息的装置如：CD、DVD、Blu-ray</span>
<span>利用其他实体物如纸卡、纸带等储存信息的装置如：打孔卡、打孔带等</span></p><p><span>正确选项D。</span></p><p>&nbsp;</p><p><span>4.以下不属于操作系统的是（）。 </span></p><p><span>A. Windows  </span></p><p><span>B. photoshop </span></p><p><span>C. Linux </span></p><p><span>D. Mac OS</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>操作系统（Operating System）是一组用来控制计算机运行、调度软件资源的软件程序，是计算机系统的核心与基石。</span></p><p><span>操作系统需要</span></p><p><span>	</span><span>-管理与配置内存</span></p><p><span>	</span><span>-决定系统资源供需的优先次序</span></p><p><span>	</span><span>-控制输入与输出装置</span></p><p><span>	</span><span>-操作网络与管理文件系统等等。</span></p><p><span>操作系统也提供一个让使用者与系统互动的操作界面。常见的操作系统有Unix，Linux，Mac OS，windows。</span></p><p><span>正确选项B。</span></p><p>&nbsp;</p><p><span>5.下列不属于面向对象编程语言的是（ ） </span></p><p><span>A. C  </span></p><p><span>B. C++ </span></p><p><span>C. JAVA </span></p><p><span>D. Python</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>面向对象程式设计（Object-oriented programming）是一种程式开发的抽象方针。对象指的是类别（class）的实例。比如小黑是只哈士奇，哈士奇是类，小黑是哈士奇类的实例，即对象。</span></p><p><span>常见的面向对象编程语言包括 Python、C++、Java、Swift、C#、Ruby、JavaScript 与 PHP等。</span></p><p><span>特别需要注意的是 C语言是面向过程的编程语言。</span></p><p><span>正确选项A。</span></p><p>&nbsp;</p><p><span>判断题</span></p><p><span>1.第一台现代电子计算机是 ENIGMA。</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>非常容易做错的题目。</span></p><p><span>ENIGMA是一种用于加密与解密文件的密码机。它是二战时期纳粹德国使用的一系列相似的转子机械加解密机器的统称。</span></p><p><span>ENIAC才是世界上第一台计算机的名字。它于1946年2月14日在美国宾夕法尼亚大学诞生。发明人是美国人莫克利（JohnW.Mauchly）和艾克特（J.PresperEckert）。它是一个庞然大物，用了18000个电子管，占地170平方米，重达30吨，耗电功率约150千瓦，每秒钟可进行5000次运算。 ENIAC以电子管作为元器件，所以又被称为电子管计算机，是计算机的第一代。美国国防部用它来进行弹道计算。</span></p><p><img src="ENIAC.png" style="zoom:50%;" /></p><p><span>错误。</span></p><p>&nbsp;</p><p><span>2.只要计算机不连接互联网，就不可能感染计算机病毒。</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>计算机病毒主要传播途径有以下四种：</span></p><p><span>	</span><span>①通过软盘等存储介质传播</span></p><p><span>	</span><span>②通过游戏软件传播</span></p><p><span>	</span><span>③通过网络传播</span></p><p><span>	</span><span>④通过计算机硬件传播</span></p><p><span>所以不联网也有可能感染计算机病毒。</span></p><p><span>错误。</span></p><p>&nbsp;</p><p><span>3.C++程序中必须要有 main 函数。</span></p><p>&nbsp;</p><p><span>【解析】：</span></p><p><span>main() 函数是 C++ 程序的入口函数，C++ 标准规定 main() 函数的返回值类型为 int，返回值用于表示程序的退出状态，返回 0 表示程序正常退出，返回非 0，表示出现异常。</span></p><p><span>正确。</span></p><p>&nbsp;</p><h2 id='二变量定义与输入输出语句'><span>二、变量定义与输入输出语句</span></h2><blockquote><p><span>复习目标：能写出C++语言的程序基本框架，能写一个定义变量，读入，输出的简单程序。</span></p></blockquote><h3 id='21-变量名命名规则'><span>2.1 变量名命名规则</span></h3><p><span>1.不能用数字开头 （起名的时候，可以叫张三，李四，但基本没有叫三张，四李，变量可以是a3, b4, 但别是3a, 4b）</span></p><p><span>2.不能有除了_之外的其他字符 </span></p><p><span>3.不能使用系统保留字（关键字） </span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//变量的定义，以整型变量为例</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-variable">a</span>;</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 42px;"></div><div class="CodeMirror-gutters" style="display: none; height: 42px;"></div></div></div></pre><p><span>所谓保留字，指C++系统中预定义的，在语言或编译系统的实现中具有特殊含义的单词。打个比方，保留字就是比你先进班级的同学，他们有个英文名字，你后进入这个班级，如果叫一样的名字，就会让所有人感到困惑。</span></p><p><span>小贴士：在一级考试中，你应该能识别出下面这些保留字</span></p><figure><table><thead><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>if</span></td><td><span>else</span></td><td><span>while</span></td><td><span>return</span></td><td><span>sizeof</span></td><td><span>switch</span></td></tr><tr><td><span>int</span></td><td><span>char</span></td><td><span>double</span></td><td><span>do</span></td><td><span>long</span></td><td><span>case</span></td></tr><tr><td><span>for</span></td><td><span>float</span></td><td><span>break</span></td><td><span>const</span></td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><p>&nbsp;</p><h3 id='22-输入输出语句'><span>2.2 输入输出语句</span></h3><p><span>先来温习一下C++语言的基本框架。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><span><span>​</span>x</span></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//头文件，理解为一个工具箱，程序中要用到的函数工具都要从这里拿</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;iostream&gt; &nbsp;</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">/*</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">名字空间的作用是防止函数重名。</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">打个比方，两个班级都有一个同学叫张明，老师为了区分，可以加上班级，六年级一班的张明，六年级二班的张明，就不会混淆了。</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">*/</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">using</span> <span class="cm-keyword">namespace</span> <span class="cm-def">std</span>; </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 主函数是程序的入口，没有就无法运行。</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-def">main</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">return</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 295px;"></div><div class="CodeMirror-gutters" style="display: none; height: 295px;"></div></div></div></pre><p><span>C++语言因为继承了C语言的绝大多数特性和语法，所以包含两种风格的输入和输出：C风格的</span><code>printf</code><span>和</span><code>scanf</code><span>在头文件</span><cstdio><span>中，C++风格的</span><code>cout</code><span>和</span><code>cin</code><span>在</span><iostream><span>中。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="c++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//C语言风格的输入和输出</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;iostream&gt; </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">using</span> <span class="cm-keyword">namespace</span> <span class="cm-def">std</span>; </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-def">main</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable-3">int</span> <span class="cm-variable">a</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">scanf</span>(<span class="cm-string">"%d"</span>, <span class="cm-operator">&amp;</span><span class="cm-variable">a</span>); <span class="cm-comment">// scanf的使用方式 , 千千万万不要遗忘了取地址符&amp;</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d"</span>, <span class="cm-variable">a</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">return</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 211px;"></div><div class="CodeMirror-gutters" style="display: none; height: 211px;"></div></div></div></pre><p><span>易错点 1</span></p><p><span>scanf函数总是忘记写取地址符&amp;.</span></p><p><span>易错点 2</span></p><p><span>scanf 和 printf 的括号里面双引号括住的格式化区域要和变量区域用逗号隔开。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">//错误的示例</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">printf("%d" a);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">//正确的用法</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">printf("%d", a);</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 84px;"></div><div class="CodeMirror-gutters" style="display: none; height: 84px;"></div></div></div></pre><p>&nbsp;</p><h3 id='23-真题解析'><span>2.3 真题解析</span></h3><p><span>单选题</span></p><p><span>1.不可以作为 C++标识符的是（） </span></p><p><span>A. </span><code>Printf</code><span>  </span></p><p><span>B. </span><code>_123</code></p><p><span>C. </span><code>While</code><span> </span></p><p><span>D. </span><code>case</code></p><p>&nbsp;</p><p><span>判断题</span></p><p><span>1.常量是在整个程序运行过程中不能改变的量。</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>常量是不变化的量。在计算机程序运行时，不会被程序修改的量。</span></p><p><span>正确。</span></p><p>&nbsp;</p><h2 id='三基本数据类型整型浮点型字符型布尔型）'><span>三、基本数据类型（整型、浮点型、字符型、布尔型）</span></h2><blockquote><p><span>复习目标：掌握数值和数据类型之间的对应关系。</span></p></blockquote><figure><table><thead><tr><th><span>类型意义</span></th><th><span>类型名</span></th><th><span>占位符</span></th><th>&nbsp;</th></tr></thead><tbody><tr><td><span>32位整型</span></td><td><span>int</span></td><td><span>%d</span></td><td>&nbsp;</td></tr><tr><td><span>单精度浮点型</span></td><td><span>float</span></td><td><span>%f</span></td><td>&nbsp;</td></tr><tr><td><span>双精度浮点型</span></td><td><span>double</span></td><td><span>%lf</span></td><td>&nbsp;</td></tr><tr><td><span>字符型</span></td><td><span>char</span></td><td><span>输入时%c，输出时%c, %d都行</span></td><td>&nbsp;</td></tr><tr><td><span>布尔型</span></td><td><span>bool</span></td><td><span>NA</span></td><td>&nbsp;</td></tr></tbody></table></figure><p>&nbsp;</p><h3 id='真题解析'><span>真题解析</span></h3><p><span>1.常量 3.14 的数据类型是（） </span></p><p><span>A. double  </span></p><p><span>B. char</span></p><p><span>C. void  </span></p><p><span>D. int</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>只有double类型能够保存小数。 </span></p><p><span>正确答案A。</span></p><p>&nbsp;</p><p><span>判断题</span></p><p><span>1.&quot;A&quot;是一个字符常量。</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>C++语言中单引号括号的是字符，而双引号括住的是字符串，两者类型不同。</span></p><p><span>错误。</span></p><h2 id='四控制语句顺序选择循环）'><span>四、控制语句（顺序、选择、循环）</span></h2><blockquote><p><span>复习方法：顺序、选择、循环的编程题目各写5个，加深理解。</span></p></blockquote><p>&nbsp;</p><h3 id='41-顺序结构'><span>4.1 顺序结构</span></h3><p><span>顺序执行就像跑步喊口号</span></p><p><span>1 ~ 2~ 3~ 4~</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//这就是顺序编程，代码会从上到下逐行运行。</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">printf</span>(<span class="cm-string">"1"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">printf</span>(<span class="cm-string">"2"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">printf</span>(<span class="cm-string">"3"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">printf</span>(<span class="cm-string">"4"</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 105px;"></div><div class="CodeMirror-gutters" style="display: none; height: 105px;"></div></div></div></pre><p>&nbsp;</p><h3 id='42-选择结构'><span>4.2 选择结构</span></h3><p><code>if ... else ...</code><span>语句就如同走到了一个丁字路口，或者“往左”或者“往右”。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">if</span> (<span class="cm-variable">a</span> <span class="cm-operator">&gt;</span> <span class="cm-number">5</span>) {</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">} <span class="cm-keyword">else</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 106px;"></div><div class="CodeMirror-gutters" style="display: none; height: 106px;"></div></div></div></pre><p><span>多个分支的</span><code>if ... else if ... else</code><span>语句可以理解为一个多通的路口，选择了一个，就不需要考虑其他的路了。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="c++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">if</span> (<span class="cm-variable">a</span> <span class="cm-operator">&gt;</span> <span class="cm-number">5</span>) {</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">} <span class="cm-keyword">else</span> <span class="cm-keyword">if</span> (<span class="cm-variable">a</span> <span class="cm-operator">&gt;</span> <span class="cm-number">3</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">} <span class="cm-keyword">else</span> <span class="cm-keyword">if</span> (<span class="cm-variable">a</span> <span class="cm-operator">&gt;</span> <span class="cm-number">1</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">} <span class="cm-keyword">else</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 190px;"></div><div class="CodeMirror-gutters" style="display: none; height: 190px;"></div></div></div></pre><p>&nbsp;</p><h3 id='43-循环结构'><span>4.3 循环结构</span></h3><p><span>while 循环</span></p><p><span>while是最基本的循环样式，可以理解为“当”型循环，即当小括号里的值为真时，就要一直做大括号里的事情。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 1 定义循环变量</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-variable">i</span> <span class="cm-operator">=</span> <span class="cm-number">1</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 2 确定循环条件</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">while</span> (<span class="cm-variable">i</span> <span class="cm-operator">&lt;=</span> <span class="cm-number">10</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 3 循环里做一些操作</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 4 更新循环变量</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">i</span><span class="cm-operator">++</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 170px;"></div><div class="CodeMirror-gutters" style="display: none; height: 170px;"></div></div></div></pre><p>&nbsp;</p><p><span>do ... while 循环</span></p><p><span>和while循环的不同在于，do...while更像一位“莽夫”，先干一次再说。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-variable">i</span> <span class="cm-operator">=</span> <span class="cm-number">1</span>;</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">do</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">printf</span>(<span class="cm-string">"%d"</span>, <span class="cm-variable">i</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">i</span><span class="cm-operator">++</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">} <span class="cm-keyword">while</span> (<span class="cm-variable">i</span> <span class="cm-operator">&lt;</span> <span class="cm-number">1</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//执行上面的程序，尽管i的值一开始就不小于1，但是还会执行一次，先执行后判断。</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 127px;"></div><div class="CodeMirror-gutters" style="display: none; height: 127px;"></div></div></div></pre><p>&nbsp;</p><p><span>for 循环</span></p><p><span>for循环可以理解为一种循环的简单写法。因为for的开始和结束条件都并列在一起，通常明确要做多少次的时候，采用for循环更清晰。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">// 从数字1 打印到 数字10</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">for (int i = 1; i &lt;= 10; i++) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>printf("%d ", i);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 85px;"></div><div class="CodeMirror-gutters" style="display: none; height: 85px;"></div></div></div></pre><p>&nbsp;</p><h3 id='44-真题解析'><span>4.4 真题解析</span></h3><p><span>判断题</span></p><p><span>1.下列代码会输出 50 个 1。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">for (int i = 1; i &lt;= 100; i *= 2) {</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> cout &lt;&lt; 1;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 63px;"></div><div class="CodeMirror-gutters" style="display: none; height: 63px;"></div></div></div></pre><p>&nbsp;</p><p><span>【解析】</span></p><p><span>因为i *= 2这句，i的取值为 {1, 2, 4, 8, 16, 32, 64, 128}，所以循环只能被运行7次，只能打印7个1。</span></p><p><span>错。</span></p><p>&nbsp;</p><p><span>2.在 if…else 语句中，配对规则是 else 总是与最近的未配对的 if 配对。</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>正确。</span></p><p>&nbsp;</p><p><span>3.在 while 语句中，while 后的()中的表达式只能是逻辑或者关系表达式。</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>while后的()本质是上需要一个值，无论何种表达式，while只看最后的结果是真还是假。所以像while (1)这样的语句，就是一直循环，也是允许的。</span></p><p><span>错误。</span></p><p>&nbsp;</p><p><span>4.for 语句的语法为：for (表达式 1; 表达式 2; 表达式 3) 语句。其中的三个 表达式均可以为空。</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>三个表达式都空表示一直循环。</span></p><p><span>正确。</span></p><p>&nbsp;</p><p><span>5.C++中，while 和 do…while 语句的功能完全相同。</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>do...while循环会做一次再判断，while是上来就判断，所以功能并不是完全相同。</span></p><p><span>错误。</span></p><p>&nbsp;</p><h2 id='五基本运算算数运算关系运算逻辑运算）'><span>五、基本运算（算数运算、关系运算、逻辑运算）</span></h2><p>&nbsp;</p><h3 id='51-算术运算'><span>5.1 算术运算</span></h3><p><span>加，减，乘，除，取模</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;iostream&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">using</span> <span class="cm-keyword">namespace</span> <span class="cm-def">std</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-def">main</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable-3">int</span> <span class="cm-variable">a</span> <span class="cm-operator">=</span> <span class="cm-number">5</span>, <span class="cm-variable">b</span> <span class="cm-operator">=</span> <span class="cm-number">2</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">+</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//加法运算，和为7</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">-</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//减法运算，差为3</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">*</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//乘法运算，积为10</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">/</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//除法运算，商为2</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">%</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//取模运算，余数为1</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">return</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 252px;"></div><div class="CodeMirror-gutters" style="display: none; height: 252px;"></div></div></div></pre><p>&nbsp;</p><h3 id='52-关系运算'><span>5.2 关系运算</span></h3><p><span>大于，小于，等于，大于等于，小于等于，不等于</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;iostream&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">using</span> <span class="cm-keyword">namespace</span> <span class="cm-def">std</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-def">main</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable-3">int</span> <span class="cm-variable">a</span> <span class="cm-operator">=</span> <span class="cm-number">5</span>, <span class="cm-variable">b</span> <span class="cm-operator">=</span> <span class="cm-number">5</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">&gt;</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//结果为假，输出为0</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">&lt;</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//结果为假，输出为0</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">==</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//结果为真，输出为1</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">&gt;=</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//结果为真，输出为1</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">&lt;=</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//结果为真，输出为1</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d\n"</span>, <span class="cm-variable">a</span> <span class="cm-operator">!=</span> <span class="cm-variable">b</span>); &nbsp;<span class="cm-comment">//结果为假，输出为0</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">return</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 273px;"></div><div class="CodeMirror-gutters" style="display: none; height: 273px;"></div></div></div></pre><p><strong><span>超级易错点！！！</span></strong></p><p><span>C语言中的一个经典陷阱就是容易把赋值符号 = 和 比较相等符号 == 搞混。</span></p><p>&nbsp;</p><h3 id='53-逻辑运算符'><span>5.3 逻辑运算符</span></h3><p><span>&amp;&amp;  与  </span></p><p><span>||     或</span></p><p><span>!       非</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include &lt;iostream&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">using</span> <span class="cm-keyword">namespace</span> <span class="cm-def">std</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-def">main</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable-3">bool</span> <span class="cm-variable">a</span> <span class="cm-operator">=</span> <span class="cm-number">1</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable-3">bool</span> <span class="cm-variable">b</span> <span class="cm-operator">=</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d"</span>, <span class="cm-variable">a</span> <span class="cm-operator">&amp;&amp;</span> <span class="cm-variable">b</span>); <span class="cm-comment">//结果为假，输出为0</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d"</span>, <span class="cm-variable">a</span> <span class="cm-operator">||</span> <span class="cm-variable">b</span>); <span class="cm-comment">//结果为真，输出为1</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">printf</span>(<span class="cm-string">"%d"</span>, <span class="cm-operator">!</span><span class="cm-variable">a</span>); &nbsp; &nbsp; <span class="cm-comment">//结果为假，输出为0</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">return</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 231px;"></div><div class="CodeMirror-gutters" style="display: none; height: 231px;"></div></div></div></pre><p>&nbsp;</p><h3 id='54-真题解析'><span>5.4 真题解析</span></h3><p>&nbsp;</p><p><span>1.如果 x 和 y 均为 int 类型的变量，且 x 的值为 1、y 的值为 2，则下列哪个表 达式的结果为 true？ </span></p><p><span>A. (x + y &gt; 7) &amp;&amp; (x - y &lt; 1) </span></p><p><span>B. !(x + y) </span></p><p><span>C. (x &gt; y - 1) || x </span></p><p><span>D. x &amp;&amp; (!y)</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>首先表达式运算结果非零为真（true），零为假（false）。</span></p><p><span>逐个分析选项。</span></p><p><span>A选项表达式用&amp;&amp;连接，两边都要为真，结果才为真。显然 x + y &gt; 7 为假。结果为假。</span></p><p><span>B选项 !(x+y) 的值为假。</span></p><p><span>D选项 !y 为假，结果为假。</span></p><p><span>正确答案C</span></p><p>&nbsp;</p><p><span>2.如果输入数据为 99 和 100，下列代码的输出结果为（）。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="C++"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="c++"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">#include&lt;iostream&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">using</span> <span class="cm-keyword">namespace</span> <span class="cm-def">std</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable-3">int</span> <span class="cm-def">main</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable-3">int</span> <span class="cm-variable">a</span>, <span class="cm-variable">b</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">cin</span> <span class="cm-operator">&gt;&gt;</span> <span class="cm-variable">a</span> <span class="cm-operator">&gt;&gt;</span> <span class="cm-variable">b</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">a</span> <span class="cm-operator">=</span> <span class="cm-variable">a</span> <span class="cm-operator">+</span> <span class="cm-variable">b</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">b</span> <span class="cm-operator">=</span> <span class="cm-variable">a</span> <span class="cm-operator">-</span> <span class="cm-variable">b</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">a</span> <span class="cm-operator">=</span> <span class="cm-variable">a</span> <span class="cm-operator">-</span> <span class="cm-variable">b</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">cout</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-variable">a</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-string">" "</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-variable">b</span> <span class="cm-operator">&lt;&lt;</span> <span class="cm-variable">endl</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">return</span> <span class="cm-number">0</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp="">
</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 274px;"></div><div class="CodeMirror-gutters" style="display: none; height: 274px;"></div></div></div></pre><p><span>A. 99 100 </span></p><p><span>B. 99 99 </span></p><p><span>C. 100 100 </span></p><p><span>D. 100 99</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>题目中的代码给出了一种交换两变量值的方法。</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 8.5px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">cin &gt;&gt; a &gt;&gt; b; &nbsp;  // 读入后 a = 99 , b = 100</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">a = a + b; &nbsp; &nbsp; &nbsp;  // 计算后 a = 199, b = 100</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">b = a - b; &nbsp; &nbsp; &nbsp;  // 计算后 a = 199, b = 99 </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">a = a - b; &nbsp; &nbsp; &nbsp;  // 计算后 a = 100, b = 99 </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">cout &lt;&lt; a &lt;&lt; " " &lt;&lt; b &lt;&lt; endl; // 输出a 和 b的值</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 105px;"></div><div class="CodeMirror-gutters" style="display: none; height: 105px;"></div></div></div></pre><p><span>正确答案D。</span></p><p>&nbsp;</p><p><span>3.如果 a 为 int 类型的变量，且 a 的值为奇数，则下列哪个表达式的结果一定 为 false？ </span></p><p><span>A. a % 2 == 1  </span></p><p><span>B. !(a % 2 == 0)  </span></p><p><span>C. !(a % 2)  </span></p><p><span>D. a % 2 </span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>对四个选项逐个计算。</span></p><p><span>A选项奇数对2取余结果一定为1，所以表达式值为真。</span></p><p><span>B选项 a % 2 == 0结果为0，对0取反，结果为真。</span></p><p><span>D选项 a % 2值为1，结果为真。</span></p><p><span>正确选项C。</span></p><p>&nbsp;</p><p><span>4.下列表达式能够正确判断“a 不等于 0 且 b 不等于 0”的是（） </span></p><p><span>A. !a == 0 || !b == 0 </span></p><p><span>B. !((a == 0) &amp;&amp; (b == 0)) </span></p><p><span>C. !(a == 0 &amp;&amp; b == 0) </span></p><p><span>D. a &amp;&amp; b</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>对四个选项逐个计算。</span></p><p><span>A选项判断的是 “a不等于0 或 b不等于0”</span></p><p><span>B选项判断的是“a不等于0 或 b不等于0”</span></p><p><span>C选项判断的和B相同。</span></p><p><span>正确选项D。</span></p><p>&nbsp;</p><p><span>5.若 a、b、c、d 均为 int 类型的变量，并且初值均为 0，以下不是正确的赋 值语句是（）。 </span></p><p><span>A. a = b = c = d = 100; </span></p><p><span>B. d++; </span></p><p><span>C. c + b; </span></p><p><span>D. d = (c = 22) - (b++);</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>A选项为同时为多个变量赋值。</span></p><p><span>B选项 d++; 是赋值语句 d = d + 1;的简写。</span></p><p><span>D选项 (c=22)虽然看起来不合理，但是C++中赋值语句有返回值为真，所以最终也能完成对d的赋值。</span></p><p><span>只有C选项没有赋值符号，表达式不完整。</span></p><p><span>正确答案C。</span></p><p>&nbsp;</p><p><span>6.A、B、C 是三个 int 类型的变量，如果已知表达式(A &gt;= B &amp;&amp; B &gt;= C)的结 果为 true，则表达式(A &gt; C || B == C)的结果（）。</span></p><p><span> A. 为 true </span></p><p><span>B. 为 false </span></p><p><span>C. 无法判定结果 </span></p><p><span>D. 当 A、B、C 都相等时为 true，否则为 false</span></p><p>&nbsp;</p><p><span>【解析】</span></p><p><span>A &gt;= B &amp;&amp; B &gt;= C 为真，则 A &gt;= B和B&gt;=C 同时为真，此时一定有A &gt;= C。</span></p><p><span>表达式 A &gt; C || B == C 中 A &gt; C 不一定为真，因为可能相等。同样B == C不一定为真，因为B 可能大于C。所以A,B选项错误。</span></p><p><span>D选项A,B,C相等为true时，否则为false。实际上A,B,C不都相等时，只要B==C那么结果还为真，所以D选项错误。</span></p><p><span>正确答案C。</span></p><p>&nbsp;</p><h2 id='考场小贴士-2'><span>考场小贴士：</span></h2><p><span>1.提前一天准备好准考证，身份证，铅笔，橡皮，签字笔收到一个小袋中，随走随拿。</span></p><p><span>2.考试时间安排：</span></p><p><span>报名时间：即日起至3月10日24点截止</span></p><p><span>模拟测试：2023年3月13-14日（具体时间请关注GESP官网通知）</span></p><p><span>认证时间：2023年3月18日，正常考试90分钟，10点开始，11点半结束</span></p><p>&nbsp;</p></div></div>

<script>(function(){var e=document.body.parentElement,t=[],n=null,i=document.body.classList.contains("typora-export-collapse-outline"),r=function(e,t,n){document.addEventListener(e,function(e){if(!e.defaultPrevented)for(var i=e.target;i&&i!=this;i=i.parentNode)if(i.matches(t)){!1===n.call(i,e)&&(e.preventDefault(),e.stopPropagation());break}},!1)};function o(){return e.scrollTop}r("click",".outline-expander",function(e){var t=this.closest(".outline-item-wrapper").classList;return t.contains("outline-item-open")?t.remove("outline-item-open"):t.add("outline-item-open"),d(),!1}),r("click",".outline-item",function(e){var t=this.querySelector(".outline-label");if(location.hash="#"+t.getAttribute("href"),i){var n=this.closest(".outline-item-wrapper").classList;n.contains("outline-item-open")||n.add("outline-item-open"),c(),n.add("outline-item-active")}});var a,s,l=function(){var e=o();n=null;for(var i=0;i<t.length&&t[i][1]-e<60;i++)n=t[i]},c=function(){document.querySelectorAll(".outline-item-active").forEach(e=>e.classList.remove("outline-item-active")),document.querySelectorAll(".outline-item-single.outline-item-open").forEach(e=>e.classList.remove("outline-item-open"))},d=function(){if(n){c();var e=document.querySelector('.outline-label[href="#'+(CSS.escape?CSS.escape(n[0]):n[0])+'"]');if(e)if(i){var t=e.closest(".outline-item-open>ul>.outline-item-wrapper");if(t)t.classList.add("outline-item-active");else{for(var r=(e=e.closest(".outline-item-wrapper")).parentElement.closest(".outline-item-wrapper");r;)r=(e=r).parentElement.closest(".outline-item-wrapper");e.classList.add("outline-item-active")}}else e.closest(".outline-item-wrapper").classList.add("outline-item-active")}};window.addEventListener("scroll",function(e){a&&clearTimeout(a),a=setTimeout(function(){l(),d()},300)});var u=function(){s=setTimeout(function(){!function(){t=[];var e=o();document.querySelector("#write").querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(n=>{var i=n.getAttribute("id");t.push([i,e+n.getBoundingClientRect().y])})}(),l(),d()},300)};window.addEventListener("resize",function(e){s&&clearTimeout(s),u()}),u()})();</script></body>
</html>